package com.ruoyi.videoMonitor.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.videoMonitor.mapper.VideoRecordMapper;
import com.ruoyi.videoMonitor.domain.VideoRecord;
import com.ruoyi.videoMonitor.service.IVideoRecordService;

/**
 * 监控视频Service业务层处理
 * 
 * @author Leo
 * @date 2024-07-12
 */
@Service
public class VideoRecordServiceImpl implements IVideoRecordService 
{
    @Autowired
    private VideoRecordMapper videoRecordMapper;

    /**
     * 查询监控视频
     * 
     * @param id 监控视频ID
     * @return 监控视频
     */
    @Override
    public VideoRecord selectVideoRecordById(Long id)
    {
        return videoRecordMapper.selectVideoRecordById(id);
    }

    /**
     * 查询监控视频列表
     * 
     * @param videoRecord 监控视频
     * @return 监控视频
     */
    @Override
    public List<VideoRecord> selectVideoRecordList(VideoRecord videoRecord)
    {
        return videoRecordMapper.selectVideoRecordList(videoRecord);
    }

    /**
     * 新增监控视频
     * 
     * @param videoRecord 监控视频
     * @return 结果
     */
    @Override
    public int insertVideoRecord(VideoRecord videoRecord)
    {
        videoRecord.setCreateTime(DateUtils.getNowDate());
        return videoRecordMapper.insertVideoRecord(videoRecord);
    }

    /**
     * 修改监控视频
     * 
     * @param videoRecord 监控视频
     * @return 结果
     */
    @Override
    public int updateVideoRecord(VideoRecord videoRecord)
    {
        videoRecord.setUpdateTime(DateUtils.getNowDate());
        return videoRecordMapper.updateVideoRecord(videoRecord);
    }

    /**
     * 批量删除监控视频
     * 
     * @param ids 需要删除的监控视频ID
     * @return 结果
     */
    @Override
    public int deleteVideoRecordByIds(Long[] ids)
    {
        return videoRecordMapper.deleteVideoRecordByIds(ids);
    }

    /**
     * 删除监控视频信息
     * 
     * @param id 监控视频ID
     * @return 结果
     */
    @Override
    public int deleteVideoRecordById(Long id)
    {
        return videoRecordMapper.deleteVideoRecordById(id);
    }
}
